Skip to content

Added components which can be used by apriltag_detector#287

Merged
wolfv merged 8 commits into
RoboStack:mainfrom
vmehta-humanoid:add_apriltag_detector_components
Apr 17, 2025
Merged

Added components which can be used by apriltag_detector#287
wolfv merged 8 commits into
RoboStack:mainfrom
vmehta-humanoid:add_apriltag_detector_components

Conversation

@vmehta-humanoid

Copy link
Copy Markdown
Contributor

Follow up PR to #286 to add some components apriltag_detector uses as composable components.

No issue # to link but if you recommend I can create one.

@traversaro

Copy link
Copy Markdown
Member

Thanks! On the Windows side we probably need to add a definition of the _USE_MATH_DEFINES macro.

@vmehta-humanoid

vmehta-humanoid commented Apr 16, 2025

Copy link
Copy Markdown
Contributor Author

Interesting failure %SRC_DIR%\ros-humble-apriltag-mit\src\work\src\TagFamily.cc(107): error C3861: '__builtin_popcountll': identifier not found I don't really need apriltag-mit so I can remove it too if the fix is not straightforward for windows. What do you think @traversaro ?

@wolfv

wolfv commented Apr 16, 2025

Copy link
Copy Markdown
Member

You could probably patch windows with something like:

https://stackoverflow.com/a/24550632

#ifdef _MSC_VER
#  include <intrin.h>
#  define __builtin_popcount __popcnt
#endif

@wolfv

wolfv commented Apr 16, 2025

Copy link
Copy Markdown
Member

Although IDK if that works for popcount_ll

@traversaro

Copy link
Copy Markdown
Member

It seems there is a simple portable implementation of that function in llvm's libcxx, we may think of using it.

@traversaro

Copy link
Copy Markdown
Member

It seems there is a simple portable implementation of that function in llvm's libcxx, we may think of using it.

https://github.com/llvm/llvm-project/blob/7f4422d99115efbb770e13ccb60cf6bfc190c245/llvm/include/llvm/ADT/bit.h#L372

@traversaro

Copy link
Copy Markdown
Member

All the apriltag_detector have unconditional add_compile_options that only make sense on GCC and Clang, not on MSVC: https://github.com/search?q=repo%3Aros-misc-utilities%2Fapriltag_detector%20Wextra&type=codem as done in https://github.com/ros2/rosidl/blob/dfdff27ea6231a39333c64a796c15fd3b7c4f839/rosidl_runtime_cpp/CMakeLists.txt#L71-L73, or simply not added on Windows.

@wolfv wolfv merged commit 9967978 into RoboStack:main Apr 17, 2025
@wolfv

wolfv commented Apr 17, 2025

Copy link
Copy Markdown
Member

Thanks!

@vmehta-humanoid vmehta-humanoid deleted the add_apriltag_detector_components branch April 17, 2025 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants